using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       LSRole_Create_SuccessSender.cs
*@brief      send message LSRole_Create_Success
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/4/14
*/

//send message LSRole_Create_Success
public class msgLSRole_Create_Success
{
    public const int MessageId = (int)LoginServerTypes.MessageType.LSRole_Create_Success;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public loginserver.UsrCreateRoleSuccess MsgContent = new loginserver.UsrCreateRoleSuccess();
	/// <summary>
	/// Initializes a new instance of the <see cref="msgLSRole_Create_Success"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='digest'>
	/// Digest.
	/// </param>
	public msgLSRole_Create_Success(int session_id, objectinfo.RoleInfoDigest digest)
	{
		SessionId = session_id;
		MsgContent.RoleDigest = digest;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of LSRole_Create_Success</param>
    public static void ProcessMessage(msgLSRole_Create_Success msg)
    {
        //TODO
        //Main Message:  msgLoginServer
		msgLoginServer mainMsg = new msgLoginServer(msg.SessionId, msgLSRole_Create_Success.MessageId, ProtoNet<loginserver.UsrCreateRoleSuccess>.IntoBytes(msg.MsgContent));
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
